//
// Created by luolijun on 2021/11/7.
//

#include "FacadeEntity.h"

#include "falcon/ui.h"

namespace falcon {

FacadeEntity::FacadeEntity() {
    _object->type = "Entity";
}

FacadeEntity::~FacadeEntity() {
}

uint32_t FacadeEntity::scope() const {
    return Scope::SCOPE_TYPE;
}

void FacadeEntity::draw(falcon::Painter& canvas) {
    canvas.drawText(rect(), falcon::AlignCenter, _object->name.c_str());
    canvas.drawRect(rect());
    canvas.drawLine(falcon::LINE(0, 50, 200, 50));
    canvas.drawLine(falcon::LINE(0, 125, 200, 125));
}

Facade* FacadeEntity::clone() const {
    FacadeEntity* newfc = new FacadeEntity();
    newfc->_size = _size;
    newfc->_center = _center;
    newfc->_object = new falcon::Object;
    newfc->_styles = new falcon::Styles;
    return newfc;
}

} // namespace falcon
